Don't touch private->parent after its been change
authorAlexander Larsson <alexl@redhat.com>
Thu, 5 Feb 2009 16:01:21 +0000 (17:01 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:16:27 +0000 (10:16 +0200)
The backend reparent may change private->parent, so we must use
the old saved value.

gdk/gdkwindow.c

index 1245e5702f8e097c1b956e8b07fc82c05fc2a1a7..7a5431d5b532cb83da36e9187ee4ba7bdeae08f3 100644 (file)
@@ -1150,8 +1150,8 @@ gdk_window_reparent (GdkWindow *window,
       new_parent_private = (GdkWindowObject *)new_parent;
     }
 
-  if (private->parent)
-    private->parent->children = g_list_remove (private->parent->children, window);
+  if (old_parent)
+    old_parent->children = g_list_remove (old_parent->children, window);
   
   private->parent = new_parent_private;
   private->x = x;